package template;

import logist.task.Task;
import logist.topology.Topology.City;

public class TaskAction {
	
	private Task task;
	
	// we define here the action by boolean is PickUp
	// if isPickUp == true  the action is pick up
	// if actionId == false the action is delivery
	private boolean isPickUp;
	private City location;
	
	
	
	public TaskAction(Task task, City location, boolean isPickUp){
		this.task = task;
		this.isPickUp = isPickUp;
		this.location = location;
	}
	
	public TaskAction(TaskAction oldTaskAction) {
		this.task = oldTaskAction.task;
		this.isPickUp = oldTaskAction.isPickUp;
		this.location = oldTaskAction.location;
	}
	
	public City getLocation(){
		return this.location;
	}
	
	public int getTaskId() {
		return this.task.id;
	}

	public Task getTask() {
		return this.task;
	}

	public boolean isPickUp() {
		return this.isPickUp;
	}
	

	public boolean equals(TaskAction t) {
		if (this.isPickUp != t.isPickUp)
			return false;
		
		if (this.task.id != t.task.id)
			return false;

		return true;
	}
	
}
